<!--添加品牌-->
<include file="public:header" />
<div class="dialog_content pad_10">
	<form id="info_form" action="{:U('item_brand/add')}" method="post">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">基本信息</li>
			<li>SEO设置</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
			<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
				<tr>
					<th>品牌名称 :</th>
					<td>
						<input type="text" id="title" name="title" class="input-text" size="40" value="{$info.title}" />
					</td>
				</tr>
				<tr>
		        	<th>品牌拼音 :</th>
		            <td>
		            	<select name="pinyin">
		            		<option value="">请选择</option>
		            		<for start="0" end="27">
		            			<option value="{$arr[$i]}" <if condition="$info['pinyin'] eq $arr[$i]">selected="selected"</if>>{$arr[$i]}</option>
		            		</for>
		            	</select>
		            </td>
		        </tr>
				<tr>
					<th>品牌图片 :</th>
					<td>
						<input type="text" name="img" id="J_img" class="input-text fl mr10" value="{$info.img}" size="30">
						<div id="J_upload_img" class="upload_btn"><span>{:L('upload')}</span></div>
					</td>
				</tr>
				<tr>
					<th>公司地址 :</th>
					<td>
						<input type="text" id="address" name="address" class="input-text" size="40" value="{$info.address}" />
					</td>
				</tr>
				<tr>
					<th>联系方式 :</th>
					<td>
						<input type="text" id="tele" name="tele" class="input-text" size="40" value="{$info.tele}" />
					</td>
				</tr>
				<tr>
		        	<th>浏览数量 :</th>
		            <td>
		            	<input type="text" id="hits" name="hits" class="input-text" size="30" value="{$info.hits}"/>
		            </td>
		        </tr>
				<tr>
					<th>品牌简介 :</th>
					<td>
						<textarea name="abst" id="abst" style="width:680px;height:120px;">{$info.abst}</textarea>
					</td>
				</tr>
				<tr>
					<th>品牌详情 :</th>
					<td>
						<textarea name="info" id="info" style="width:700px;height:300px;">{$info.info}</textarea>
					</td>
				</tr>
				
				<tr>
		        	<th>有效状态 :</th>
		            <td>
		            	<label><input type="radio" name="status" value="1" <if condition="$info.status eq 1">checked</if>> 有效</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<label><input type="radio" name="status" value="0" <if condition="$info.status eq 0">checked</if>> 无效</label>
		            </td>
		        </tr>
			</table>
			</div>
			<div class="content_list pad_10">
				<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
					<tr>
						<th>{:L('seo_title')}</th>
						<td><input type="text" name="seo_title" id="seo_title" value="{$info.seo_title}" class="input-text" size="70"></td>
					</tr>
					<tr>
						<th>{:L('seo_keys')}</th>
						<td><input type="text" name="seo_keys" id="seo_keys" class="input-text"  value="{$info.seo_keys}" size="70"></td>
					</tr>
					<tr>
						<th>{:L('seo_desc')}</th>
						<td><textarea name="seo_desc" id="seo_desc" cols="70" rows="3">{$info.seo_desc}</textarea></td>
					</tr>
				</table>
			</div>
		</div>
		<div class="mt10"><input type="submit" value="{:L('submit')}" class="btn btn_submit"></div>
		<input type="hidden" name="menuid"  value="{$menuid}"/>
	</form>
</div>
<include file="public:footer" />
<script src="__STATIC__/js/kindeditor/kindeditor.js"></script>
<script src="__STATIC__/js/fileuploader.js"></script>
<script type="text/javascript">

$(function(){
	KindEditor.create('#info', {
		uploadJson : '{:U("attachment/editer_upload")}',
		fileManagerJson : '{:U("attachment/editer_manager")}',
		allowFileManager : true
	});
	$('ul.J_tabs').tabs('div.J_panes > div');
	//上传图片
	var uploader = new qq.FileUploaderBasic({
		allowedExtensions: ['jpg','gif','jpeg','png','bmp','pdg'],
	    button: document.getElementById('J_upload_img'),
	    multiple: false,
	    action: "{:U('item_brand/ajax_upload_img')}",
	    inputName: 'img',
	    forceMultipart: true, //用$_FILES
	    messages: {
	    	typeError: lang.upload_type_error,
	    	sizeError: lang.upload_size_error,
	    	minSizeError: lang.upload_minsize_error,
	    	emptyError: lang.upload_empty_error,
	    	noFilesError: lang.upload_nofile_error,
	    	onLeave: lang.upload_onLeave
	    },
	    showMessage: function(message){
	    	$.pinphp.tip({content:message, icon:'error'});
	    },
	    onSubmit: function(id, fileName){
	    	$('#J_upload_img').addClass('btn_disabled').find('span').text(lang.uploading);
	    },
	    onComplete: function(id, fileName, result){
	    	$('#J_upload_img').removeClass('btn_disabled').find('span').text(lang.upload);
	        if(result.status){
	    		$('#J_img').val(result.data);
	    	} else {
	    		$.pinphp.tip({content:result.msg, icon:'error'});
	    	}
	    }
	});
});
</script>
